class MonkeyRuntime;

#ifndef __MONKEYRUNTIME_H__
#define __MONKEYRUNTIME_H__

#include <js/jsapi.h>
#include <list>
#include "MonkeyContext.h"

class MonkeyRuntime {
  private:
    JSRuntime	*runtime;
    std::list<MonkeyContext *>    contexts;

    MonkeyRuntime();

  public:
    ~MonkeyRuntime();
    
    MonkeyContext *CreateContext();
    void DestroyContext(MonkeyContext *ctx);
    
    static MonkeyRuntime *SharedRuntime();

    friend class MonkeyContext;
};

#endif /* __MONKEYRUNTIME_H__ */
